/*
 * unittest2.c
 *
 *  Created on: Apr 27, 2014
 *      Author: chuaprar
 */

/*
 * Include the following lines in your makefile:
 *
 * unittest2: unittest2.c dominion.o rngs.o
 *      gcc -o unittest2 -g  unittest2.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include <stdlib.h>

#define TESTFUNC "getCost()"

int main() {
	int i;
	int numCards = 27;

	// list of cards
	char* card[] = {"curse", "estate", "duchy", "province", "copper",
			"silver", "gold", "adventurer", "council_room", "feast",
			"gardens", "mine", "remodel", "smithy", "village",
			"baron", "great_hall", "minion", "steward", "tribute",
			"ambassador", "cutpurse", "embargo", "outpost", "salvager",
			"sea_hag", "treasure_map"};

	// source:	http://boardgamegeek.com/thread/457960/list-of-all-dominion-cards,
	//			http://dominioncg.wikia.com/wiki
	int cardCost[] = 	{0,2,5,8,0,  3,6,6,5,4,  4,5,4,4,3,  4,3,5,3,5,  3,4,2,5,4,  4,4};

	printf("----------------- Testing: %s ----------------\n", TESTFUNC);

	for (i=0; i<numCards; i++) {
		printf("%15s: cost = %d, expected = %d\n", card[i], getCost(i), cardCost[i]);
		assert(getCost(i) == cardCost[i]);
	}

    printf("\n >>>>> SUCCESS: Testing complete for %s <<<<<\n\n", TESTFUNC);

    return 0;
}

